package com.sms.platform.mq;

import com.sms.platform.common.model.Standard_Report;
import com.sms.platform.common.model.Standard_Submit;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author xjh
 * @date 2020-08-11
 */
@Component
public class SmsSender {

    @Autowired
    private RabbitTemplate template;

    public void sendMessage(String routingKey, Standard_Submit submit){
        // 1表示以http形式发送短信
        submit.setSource(1);
        template.convertAndSend(routingKey, submit);
    }

    public void sendMessage(String routingKey, Standard_Report submit){
        template.convertAndSend(routingKey, submit);
    }
}